package com.qh.yyxt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qh.yyxt.entity.BorrowThing;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface BorrowThingMapper extends BaseMapper<BorrowThing>
{
    //添加一个记录
    public int addBorrowThing(List<BorrowThing> list);
    //修改一些信息
    public int updateInfo(Integer id,Integer acnum, Integer badnum,String state);
    //只修改状态
    public int updateState(Integer id,String state);
    //根据fid批量修改state
    public int updateStateByFid(Integer fid,String state);
    //根据fid查询
    public List<BorrowThing>findByFid(Integer fid);
    //根据id查询
    public BorrowThing findById(Integer id);
    //根据state查询
    public List<BorrowThing>findByState(Integer fid,String state);
    //根据badnum查询用来判断损坏的物品
    public Integer findByBadBum(Integer fid);
    //查询该sid还有没有正在使用中的
    public Integer findBySid(Integer sid);

    public int deleteBySid(Integer sid);
    public int deleteByTid(Integer tid);
}
